package com.h6.crm.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;

import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
@TableName("So_Client")
public class BaseEntity {

    @Schema(description = "ID")
    @TableId(value = "Id", type = IdType.AUTO)
    Long id;

    @Schema(description = "创建者")
    @TableField(value = "Creater", fill = FieldFill.INSERT)
    String creater;

    @Schema(description = "创建时间")
    @TableField(value = "CreateTime", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    Date createTime;

    @Schema(description = "修改者")
    @TableField(value = "Modify", fill = FieldFill.INSERT_UPDATE)
    String modify;

    @Schema(description = "修改时间")
    @TableField(value = "ModifyTime", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    Date modifyTime;

    @TableField("Status")
    Integer status;

    @TableField("Enabled")
    Boolean enabled;

    @Schema(description = "备注")
    @TableField("FRemarks")
    String fRemarks;

    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    Boolean Deleted;

}
